package com.itheima.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.common.PageBean;
import com.itheima.dto.LogDto;
import com.itheima.mapper.LogMapper;
import com.itheima.pojo.OperateLog;
import com.itheima.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;
    /**
     * 用于分页查询日志信息
     *
     * @return Result
     */
    @Override
    public PageBean list(LogDto logDto) {
        PageHelper.startPage(logDto.getPage(),logDto.getSize());
        Page<OperateLog> page = logMapper.List(logDto);
        return new PageBean(page.getTotal(), page.getResult());
    }
}
